#include <stdio.h>
#include <fcntl.h>

int main(){
    int inFile, outFile;
    char *inFileName = "in_test.txt";
    char *outFileName = "out_test.txt";
    int len;
    char c;

    inFile = open(inFileName, O_RDONLY);
    outFile = open(outFileName, O_WRONLY);

    /* Loop through the input file */
    while ((len = read(inFile, &c, 2))>0)
        write(outFile, &c, 1);

    /* Close files and quite */
    close(inFile);
    close(outFile);
}
